<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <title>Title</title>
</head>
<body>
<script>
  var a = 0;

  function play (data) {
    const value = data.value;
    console.log(value)
    if (value >= 16) {
      console.log('16666666')
    } else if (value >= 8) {
      console.log('88888888')
    } else if (value >= 4) {
      console.log('44444444')
    } else if (value >= 2) {
      console.log('22222222')
    } else {
      console.log('00000000')
    }
  }

  function* create () {
    yield a |= 1;
    yield a |= 2;
    yield a |= 4;
    yield a |= 8;
    yield a |= 16;
  }

  var add = create()

  play(add.next())
  play(add.next())
  play(add.next())
  play(add.next())
  play(add.next())
  play(add.next())


</script>
</body>
</html>
